

package br.com.digitalpoint.dao;

import br.com.digitalpoint.Abono;
import br.com.digitalpoint.utils.*;
import java.sql.*;


public class AbonoDAO {

    public void abonarFalta (Abono objFalta) throws Exception {
        try {
            String insere = "UPDATE TBAbonos set data = ? WHERE matricula = ? ";
            Connection con = FabricaConexao.abreConexao();
            PreparedStatement ps = con.prepareStatement(insere);
            ps.setInt(2, objFalta.getCodigo());
            //conversoes das datas
            java.util.Date data = objFalta.getDataRegistro();
            java.sql.Date dtRegistro = new java.sql.Date(data.getTime());
            ps.setDate(1, dtRegistro);
            ps.execute();

        } catch (Exception e) {
            throw e;
        }
    }
}
